package com.server.rest.api.demo;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import com.server.rest.protocol.demo.SizeReq;
import com.server.rest.protocol.demo.SizeResp;
import com.server.service.demo.IDemoService;

@RestController
@RequestMapping(value = "/api/v1/demo")
public class DemoController {
	@Autowired
	private IDemoService demoService;
	
	@RequestMapping(value="size_count",method=RequestMethod.POST)
	public SizeResp getSize(@RequestBody SizeReq sizeReq){
		SizeResp resp = new SizeResp();
		resp.setSize(demoService.countSize(sizeReq.getContent()));
		return resp;
	}
}
